<template>
	<div>
		<Modal v-model="modal3" title="选择文章" @on-ok="addSubmit" @on-cancel="cancel" class="tanchuang">
			<!-- <Input search enter-button="搜索" placeholder="Enter something..." on-search="searchSubmit"/> -->
			<Input v-model="searchName" placeholder="请输入">
			<Button slot="append" icon="ios-search" @click="searchSubmit"></Button>
			</Input>
			<div  class="srcoll" style="text-align:left;">
				<div v-if="renyuanlist.length>0">
					<RadioGroup v-model="salesStatus" @on-change="radioChange($event)">
						<Radio :label="item.id+','+item.articleTitle" style="margin-right:28px" v-for="(item,index) in renyuanlist"
						 :key="index">
							<span style="float:right">{{item.articleTitle}}</span>
						</Radio><br>
					</RadioGroup>
				</div>

				<div v-else>
					暂无
				</div>

			</div>
    
		</Modal>
	</div>
</template>
<script>
	import Rest from '@/rest'
	import Api from '@/api'
	//import Bus from '@/store/bus'
	import Helper from '@/common/helper'
	
	import consts from '@/utils/consts'
	export default {
		data() {
			return {
				addauther: false,
				modal3: false,
				renyuanlist: [

				],
				searchName: '',
				salesStatus: '',
				auther: '',
				str: '',
				inputItemed: '',
				formItem: "",
				cityCode:""
			}
		},
		methods: {
			init(v) {
			    this.modal3 = true;
		        this.cityCode = v
			},

			searchSubmit() {
				var that = this
		          var restApi = Api.caseManage.seo.selectList;
		          var param = {
		          	title: that.searchName,
		          	type:0,
		          	cityCode:this.cityCode
		          }
		          Helper.globalLoading_show();
		          Rest.get(restApi, param).done(function(res) {
		          	if (Helper.isSuccess(res)) {
		          		that.renyuanlist = res.data
		          	} else {
		          		that.$Message.error(res.status.msg);
		          	}
		          	Helper.globalLoading_hide();
		          });
				
			},
			radioChange(v) {
				this.str = v;
			},
      linkChange(v) {
        this.str = v;
      },
			addSubmit() {
				var dataIntArr = []
				if (this.str == "") {} else {
					this.str.split(",").forEach(function(data, index, arr) {
						dataIntArr.push(data);
					});
					this.$emit("addautoername", dataIntArr[0], dataIntArr[1])
				}
				this.searchName = '';
				this.renyuanlist = [];
			},
			cancel() {
				this.searchName = '';
				this.renyuanlist = [];
			}
		}
	}
</script>
<style lang="scss" scoped>
	@import "@/assets/sass/install";

	.srcoll {
		height: 200px;
		margin: 20px 10px;
		overflow-y: scroll;
	}

	.srcoll .ivu-radio-wrapper {
		display: block;
		margin: 10px 0px;
	}

	.red {
		color: red;
	}

	.formList {
		width: 100%;
		margin-top: 10px;
		border: none;
	}

	.option-auto {
		max-height: 255px;
		overflow: auto;
	}

	.option-auto table {
		margin-top: 0 !important;
	}

	.table table {
		width: 100%;
		margin-top: 28px;
		font-size: 14px;
		border-spacing: 0;
		border-collapse: collapse;
	}

	.formList table tr:first-child {
		background: #f2f2f2;
	}

	.formList table tr:nth-child(odd) {
		background-color: #f8f9fa;
	}

	.formList table th {
		color: #0e0e0e;
		vertical-align: middle;
	}

	.formList table th {
		font-size: 15px;
	}

	.formList table td,
	.formList table th {
		padding: 10px 15px;
		border: 1px solid #dddfe2;
	}

	.formList table tr:nth-child(even) {
		background-color: #fff;
	}

	.formList table td {
		vertical-align: middle;
		text-align: center;
		white-space: nowrap;
		overflow: hidden;
	}

	.paddingleft {
		padding-right: 20px;
	}

	.demo-spin-col .ivu-spin-fix {
		background: #ddd;
	}

	.liayuan {
		height: 200px;
		overflow-y: auto;
		margin: 15px;
	}

	.cityId,
	.city,
	.areaId {
		margin-left: 20px;
		margin-top: 10px;
	}

	.table1 {
		border: 0;
		padding: 0;
		margin: 0;

	}

	.table1 tr {}

	.table1 tr td {}

	.table2 {
		border: 0;
		padding: 0;
		margin: 0;


	}

	.table2 tr {}

	.table2 tr td {}

	.table2 tr td.td1 {
		border-left: 0px;
	}

	.table2 tr td.td2 {
		border-bottom: 0px;
	}

	.housetype_add {
		.conten .selHouseType {
			font-size: 14px;
			color: #949495;
			padding-right: 15px;
			position: absolute;
			top: 0;
			right: -100px;
		}

		.ivu-form-item-content {
			position: relative;

			.area {
				position: absolute;
				top: 0;
				right: 67px;
				color: #949495;
			}

			.tip {
				display: block;
				padding-left: 0;
			}
		}

		.ivu-form {
			.ivu-form-item:nth-child(3) {
				display: inline-block;
				width: 100px;
			}

			.ivu-form-item:nth-child(4) {
				display: inline-block;
				width: 100px;
			}

			.ivu-form-item:nth-child(2) {
				display: inline-block;
				width: 100px;
			}

			.ivu-form-item-error-tip {
				width: 150px;
			}
		}

		.required {
			position: absolute;
			top: 10px;
			left: -95px;
			height: 15px;
			line-height: 19px;
			font-family: "Microsoft YaHei";
			font-size: 16px;
			color: #ff3300;
		}
	}

	.ivu-modal-wrap {
		.ivu-modal {
			.ivu-modal-footer {
				.isUrm {
					width: 130px;
				}
			}
		}
	}

	.vertical-center-modal {
		display: flex;
		align-items: center;
		justify-content: center;

		.ivu-modal {
			top: 0;
		}
	}
</style>
